package com.cloudlinkscm.loms.services.base.notify.dto.email.builder.component;

import com.cloudlinkscm.loms.services.base.notify.dto.email.EmailMessageDto;
import com.cloudlinkscm.loms.services.base.notify.dto.email.builder.EmailMessageDtoBuilder;
import com.cloudlinkscm.loms.services.base.notify.dto.email.builder.EmailMessageDtoBuilderDecorator;

/**
 * @author : tac
 * @date : 2017/7/12
 */
public class EmailMessageDtoSettingsBuilderDecorator extends EmailMessageDtoBuilderDecorator {
    private boolean isReturn = false;
    private boolean isPriority = false;
    private boolean isSsl = false;

    public EmailMessageDtoSettingsBuilderDecorator(EmailMessageDtoBuilder builder) {
        super(builder);
    }

    @Override
    public EmailMessageDto build() {
        EmailMessageDto dto = builder.build();
        dto.setSsl(isSsl);
        dto.setPriority(isPriority);
        dto.setReturn(isReturn);
        return dto;
    }

    public EmailMessageDtoSettingsBuilderDecorator ssl(){
        this.isSsl = true;
        return this;
    }
    public EmailMessageDtoSettingsBuilderDecorator priority(){
        this.isPriority = true;
        return this;
    }
    public EmailMessageDtoSettingsBuilderDecorator needReturn(){
        this.isReturn = true;
        return this;
    }
}
